#pragma once

#ifndef _CZONE_H_
#define _CZONE_H_


class CZone
{
private:

	// ID of the zone
	unsigned short m_zoneID;

	// List of pointers of all chars in the zone
	std::vector<CChar *> m_charsInZone;

	// struct that holds the information about the zones music
	struct zoneMusic m_zoneMusic;

	// struct that olds the weather information for the zone
	struct zoneWeather m_zoneWeather;

	// list to hold all zonelines in the zone
	std::vector<struct zoneLine> m_zoneLineList;

	CSemaphore* m_zoneActiveSemaphore;
	CSemaphore* m_charListMutex; 
	CSemaphore* m_entityTreeMutex; 

public:
	// loads a zone to a ID
	CZone::CZone(unsigned short zoneID);
	CZone::~CZone();
	//returns the zone ID
	unsigned short CZone::getId();

	// loads the zoneline into the m_zoneLineList vector
	void CZone::loadZoneLines();

	// loads the music IDs into the music struct
	void CZone::loadZoneMusic();
	
	// returns the last weather on the zone
	struct weather CZone::getLastWeather();

	// returns the current weather on the zone
	struct weather CZone::getCurrentWeather();

	// returns the next time the weather should change
	unsigned long long CZone::getNextWeatherChange();

	// sets the next time the weather should change
	void CZone::setNextWeatherChange(unsigned long long nextChangeTime);

	// pushes the current weather to last weather and the new weather parameter to current weather
	void CZone::setZoneWeather(struct weather newWeather);

};
#endif
